<?php

namespace Application\Repository;

use Doctrine\ORM\EntityRepository;

class UsuarioRepository extends EntityRepository {

	/**
	 * Verifica se existe usuário com Senha.
	 * @param type $noLogin
	 * @param type $noSenha
	 * @return boolean
	 */
	public function findByUsuarioAndSenha($noLogin, $noSenha) {
		$user = $this->findOneBy(array('noUsuario' => $noLogin,'noSenha'=>$noSenha));
		if($user) {
			return $user;
		}else{
			return FALSE;
		}
	}
	
	public function findByCookie($cookie)
	{
		$user = $this->findOneBy(array('stCookie' => $cookie));
		if($user) {
			return $user;
		}else{
			return FALSE;
		}
	}

}
